Add external git hooks backend (#1250)#1265
Open
SnowingFox wants to merge 1 commit into
Open
Conversation
New git_hooks.backend = "external" setting redirects Entire's hook detection from .git/hooks/ to a user-managed external_dir (e.g. .husky, common/git-hooks). In external mode Entire never writes to the user's hook directory or to .git/hooks/ — it only checks for the marker "Entire CLI hooks" in scripts the user maintains. - settings: GitHooksSettings (backend + external_dir) with whole-block merge, repo-relative + no-".." validation, strict enum on backend - strategy: GetGitHookDetectionDir branches detection by backend; InstallGitHook / RemoveGitHook / CheckAndWarnHookManagers short-circuit in external mode via shared externalGitHooksDir helper - setup: verifyExternalGitHooksPrecondition gates every enable variant on external_dir existence and surfaces a 5-script instructional help message (FormatExternalDirMissingHelp, shared with doctor); status line uses PrintExternalHookStatusIfActive - doctor: new checkExternalGitHooks surfaces ✓/✗ for external_dir, contributes to overall doctor exit code, stays silent in direct mode - tests: settings (7) + hooks (6) + hook_managers (1) + doctor (3) + integration end-to-end Husky-shape (2) - docs: new docs/architecture/external-git-hooks.md covering rationale, user contract, all 5 hook script templates, migration paths Co-authored-by: Cursor <cursoragent@cursor.com> Entire-Checkpoint: f184ee6ced2f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #1250
New git_hooks.backend = "external" setting redirects Entire's hook detection from .git/hooks/ to a user-managed external_dir (e.g. .husky, common/git-hooks). In external mode Entire never writes to the user's hook directory or to .git/hooks/ — it only checks for the marker "Entire CLI hooks" in scripts the user maintains.